<html><input type='file' accept='text/plain' onchange='openFile(event)'><br>
<img id='output'>
<p id="test">hey </p>


<script>document.getElementById('test').innerHTML="asf";
var openFile = function(event) {
  var input = event.target;
  this.datapoints=[];
  var reader = new FileReader();
  this.display='';
  reader.onload = function(){
    var text = reader.result;
	var lines = text.split(/[\r\n]+/g);
	this.display="sdg";
	console.log(reader.result.substring(0, 200));
	
  };
	reader.readAsText(input.files[0]);
	document.getElementById('test').innerHTML=this.display; 
	
};
function isNumber(n){
	var numbers = [1,2,3,4,5,6,7,8,9,0];
	for (var i=0;i<numbers.length;i++){
		if (n==numbers[i])
			return true;
	}
	return false;
}


</script>
</html>